function curry(func) {
    return function curriedFn(...args) {
        //判断实参形参个数
        if (args.length < func.length) {
            return function () {
                return curriedFn(...args.concat(Array.from(arguments)))
            }
        } else {
            return func(...args)
        }
    }
}

const curried = curry(getSum)
console.log(curried(1)(2)(3))
const currys = fn => currieds = (...args) => {
    if (fn.length === args.length) return fn(...args)
    else return (...args) => currieds(...[...args, ...args])
}

function getSum(a, b, c) {
    return a + b + c
}

const curriedd = currys(getSum)

console.log(curriedd(1)(2)(3))
